import user from 'api/user.js'
import { arrayCopy } from 'utils'

export default {
	namespaced: true,
	state: {
		username: '',
		sessionid: '',
	},
	getters: {
		logged(state) {
			if (typeof(state.sessionid) === 'string' &&
				state.sessionid !== '' )
				return true;
			else 
				return false;
		},
	},
	mutations: {
		login(state, [sessionid, username]) {
			state.sessionid = sessionid;
		},
		logout(state) {
			state.sessionid = '';
		},
	},
}